/**
 * 
 */
package com.swim.shop.entity;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 产品订单Entity
 * @author ljw
 * @version 2023-05-24
 */
@Table(name="t_product_order", alias="a", columns={
		@Column(name="id", attrName="id", label="唯一标识", isPK=true),
		@Column(name="order_num", attrName="orderNum", label="订单号"),
		@Column(name="product_id", attrName="productId", label="产品id"),
		@Column(name="sys_user_id", attrName="sysUserId", label="付款人id"),
		@Column(name="payer_phone", attrName="payerPhone", label="付款人手机号"),
		@Column(name="pay_type", attrName="payType", label="支付方式"),
		@Column(name="pay_number", attrName="payNumber", label="支付单号"),
		@Column(name="pay_date", attrName="payDate", label="支付时间"),
		@Column(name="buy_number", attrName="buyNumber", label="购买数量"),
		@Column(name="should_pay", attrName="shouldPay", label="应付"),
		@Column(name="actual_pay", attrName="actualPay", label="实付"),
		@Column(name="actual_handle", attrName="actualHandle", label="实收"),
		@Column(name="order_status", attrName="orderStatus", label="订单状态 1表示未付款 2表示已付款 3表示已关闭"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class ProductOrder extends DataEntity<ProductOrder> {
	
	private static final long serialVersionUID = 1L;
	private String orderNum;		// 订单号
	private String productId;		// 产品id
	private String sysUserId;		// 付款人id
	private String payerPhone;		// 付款人手机号
	private String payType;		// 支付方式
	private String payNumber;		// 支付单号
	private Date payDate;		// 支付时间
	private Long buyNumber;		// 购买数量
	private Double shouldPay;		// 应付
	private Double actualPay;		// 实付
	private Double actualHandle;		// 实收
	private Long orderStatus;		// 订单状态 1表示未付款 2表示已付款 3表示已关闭
	
	public ProductOrder() {
		this(null);
	}

	public ProductOrder(String id){
		super(id);
	}
	
//	@NotBlank(message="订单号不能为空")
	@Length(min=0, max=20, message="订单号长度不能超过 20 个字符")
	public String getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(String orderNum) {
		this.orderNum = orderNum;
	}
	
	@NotBlank(message="产品id不能为空")
	@Length(min=0, max=64, message="产品id长度不能超过 64 个字符")
	public String getProductId() {
		return productId;
	}

	public void setProductId(String productId) {
		this.productId = productId;
	}
	
	@NotBlank(message="付款人id不能为空")
	@Length(min=0, max=64, message="付款人id长度不能超过 64 个字符")
	public String getSysUserId() {
		return sysUserId;
	}

	public void setSysUserId(String sysUserId) {
		this.sysUserId = sysUserId;
	}
	
//	@NotBlank(message="付款人手机号不能为空")
	@Length(min=0, max=20, message="付款人手机号长度不能超过 20 个字符")
	public String getPayerPhone() {
		return payerPhone;
	}

	public void setPayerPhone(String payerPhone) {
		this.payerPhone = payerPhone;
	}
	
	@NotBlank(message="支付方式不能为空")
	@Length(min=0, max=10, message="支付方式长度不能超过 10 个字符")
	public String getPayType() {
		return payType;
	}

	public void setPayType(String payType) {
		this.payType = payType;
	}
	
	@Length(min=0, max=50, message="支付单号长度不能超过 50 个字符")
	public String getPayNumber() {
		return payNumber;
	}

	public void setPayNumber(String payNumber) {
		this.payNumber = payNumber;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getPayDate() {
		return payDate;
	}

	public void setPayDate(Date payDate) {
		this.payDate = payDate;
	}
	
	@NotNull(message="购买数量不能为空")
	public Long getBuyNumber() {
		return buyNumber;
	}

	public void setBuyNumber(Long buyNumber) {
		this.buyNumber = buyNumber;
	}
	
	@NotNull(message="应付不能为空")
	public Double getShouldPay() {
		return shouldPay;
	}

	public void setShouldPay(Double shouldPay) {
		this.shouldPay = shouldPay;
	}
	
	public Double getActualPay() {
		return actualPay;
	}

	public void setActualPay(Double actualPay) {
		this.actualPay = actualPay;
	}
	
	public Double getActualHandle() {
		return actualHandle;
	}

	public void setActualHandle(Double actualHandle) {
		this.actualHandle = actualHandle;
	}
	
//	@NotNull(message="订单状态 1表示未付款 2表示已付款 3表示已关闭不能为空")
	public Long getOrderStatus() {
		return orderStatus;
	}

	public void setOrderStatus(Long orderStatus) {
		this.orderStatus = orderStatus;
	}
	
}